package com.ibeeking.found.content.cp.rest.controller.v1.feign;


import com.ibeeking.nematos.constants.enums.LogClassifyEnum;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import com.ibeeking.nematos.redis.utils.RedisUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;

/**
 * @ClassName PermissionController控制器
 * @Description
 * @Author ibeeking
 * @Date 2020-12-01 18:15
 **/
@RestController
@RequestMapping("/cp/redis/feign/v1")
public class RedisFeignController {

    @Resource
    private RedisUtils redisUtils;

    @Log(logType = OperateLogTypeEnum.MODIFY, logClassify = LogClassifyEnum.TRACE_LOG, describe = "修改Redis")
    @PostMapping(value = "/refresh/{key}")
    public Boolean refresh(@PathVariable @NotBlank(message = "redisKey不能为空") String key) {
        redisUtils.expire(key, 0L);
        return true;
    }
}
